//
//  ViewController.m
//  JMPhotoWeb
//
//  Created by JM Zhao on 2017/9/6.
//  Copyright © 2017年 JunMing. All rights reserved.
//

#import "ViewController.h"
#import "JMBrowserModel.h"
#import "JMBrowserView.h"

#define JMDocumentsPath [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES) objectAtIndex:0]

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    NSMutableArray *dataSource = [NSMutableArray array];
    for (int i = 0; i < 15; i ++) {
        
        JMBrowserModel *model = [[JMBrowserModel alloc] init];
        model.imagePath = [JMDocumentsPath stringByAppendingPathComponent:[NSString stringWithFormat:@"0%02d.JPG", i]];
        [dataSource addObject:model];
    }

    JMBrowserView *view = [[JMBrowserView alloc] initWithFrame:self.view.bounds];
    view.dataSource = dataSource;
    [self.view addSubview:view];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
